import http from "../utils/https";
export const getCommentAPI = (id) => {
  if (id) {
    return http({
      url: `message?id=${id}`,
      method: "get",
    });
  } else {
    return http({
      url: `message`,
      method: "get",
    });
  }
};
export const patchCommentAPI = (
  id,
  { dianzan, pinglun, shoucang },
  excontent
) => {
  const keys = Object.keys(excontent);
  const length = keys.length;
  return http({
    url: `message/${id}`,
    method: "PATCH",
    data: {
      dianzan: dianzan,
      pinglun: length,
      shoucang: shoucang,
      excontent: excontent,
    },
  });
};
